const SendZipDirWebpackPlugin = require('@liepin/send-zip-dir-webpack-plugin');
const { paths, log } = require('@fet/fe-reactcli-webpack-tools/utils');

let sendSourceMapData = {
  name: `${paths.projectName}-sourcemap.zip`, // 压缩后的文件名, 可以不指定
  dir: paths.sourcemapAsset, // 需要发送的文件夹的绝对路径, * 必须
  url: 'http://monitor.lietou.com/saveSourcemap', // 服务器接口， * 必须
  data: { // 随着服务端接口发送的数据
    projectName: paths.projectName
  },
  success: data => {
    log.success(data || 'source-map文件已发送至前端日志平台！');
  }
};

const sendSourceMap = new SendZipDirWebpackPlugin(sendSourceMapData)
sendSourceMap.initSend();
